package net.test.piggy.util;

import net.test.piggy.model.Result;

import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class NumberEncryptionUtil {

    public static String encode(String string){
        if(string!=null){
            byte[] bytes = string.getBytes(StandardCharsets.UTF_8);
            return Base64.getEncoder().encodeToString(bytes);
        }
        return null;
    }

    public static String decode(String string){
        if(string!=null){
            byte[] bytes = Base64.getDecoder().decode(string);
            return new String(bytes, StandardCharsets.UTF_8);
        }
        return null;
    }

}
